/***********************************************************************
    filename:   DaterCalendarControlWindow.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines class for a window objects to control calendar in UI
*************************************************************************/
#ifndef _DaterCalendarControlWindow_h_
#define _DaterCalendarControlWindow_h_

#include "DaterBaseWindow.h"
#include "CEGUI.h"

class CalendarControlWindow : public BaseWindow
{
	/*!
	\brief
		UI calendar control windows.
	*/
public:
		/* !
		\brief
			Construct the sample of class CalendarControlWindow.

		\param id_name
			- a string to represent the prefix of the window.
			
		\param parent
			- point to parent window.
		*/
		CalendarControlWindow(const CEGUI::String& id_name, CEGUI::Window* parent = 0);
	
		/*!
			Destructor of class CalendarControlWindow.
		*/
		~CalendarControlWindow();

		/* !
		\brief
			a virtual function generated from class BaseWindow to show window.
		*/
	virtual void showWindow();
	
		/* !
		\brief
			a virtual function generated from class BaseWindow to hide window.
		*/
	virtual void hideWindow();

private:
		/* !
		\brief
			Subscribe handler to each 'slot' in the layout.
		*/
	void subscribeEvent();
	
		//! An int to present year of calendar.
	int _year;
	
		//! An int to present month of calendar.
	int _month;

		//! A string to present the prefix of calendar.
	CEGUI::String _prefix;

		/* !
		\brief
			Set To Next Month.
			
		\param args
			- the processing program.
		*/
	bool setToNextMonth(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Set To Previous Month.
			
		\param args
			- the processing program.
		*/
	bool setToPreviousMonth(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Set To Next Year.
			
		\param args
			- the processing program.
		*/
	bool setToNextYear(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Set To Previous Year.
			
		\param args
			- the processing program.
		*/
	bool setToPreviousYear(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Subscribe handler to each 'slot' in the layout.
			
		\param args
			- the processing program.
		*/
	bool handle_select_day(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Link the process when connected.
			
		\param args
			- the processing program.
		*/
	bool handle_show_calendarControl(const CEGUI::EventArgs& args);
	
		/* !
		\brief
			Hide the process when connected.
			
		\param args
			- the processing program.
		*/
	bool handle_hide_calendarControl(const CEGUI::EventArgs& args);

		/* !
		\brief
			Get the Year Head of the Text.
		*/
	std::string getYearHeadText();
	
		/* !
		\brief
			Get the Month Head of the Text.
		*/
	std::string getMonthHeadText();

		//! A int* contains previous month of the process.
	int* _previousMonthData;
	
		//! A window* contains current day block of the process.
	CEGUI::Window* _currentDayBlock;
	
		//! A int* contains next month of the process.
	int* _nextMonthData;
};

#endif